(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
app(nil, y) → y
app(add(n, x), y) → add(n, app(x, y))
reverse(nil) → nil
reverse(add(n, x)) → app(reverse(x), add(n, nil))
shuffle(nil) → nil
shuffle(add(n, x)) → add(n, shuffle(reverse(x)))
Rewrite Strategy: INNERMOST
(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted CpxTRS to CDT
(2) Obligation:
Complexity Dependency Tuples Problem
Rules:
app(nil, z0) → z0
app(add(z0, z1), z2) → add(z0, app(z1, z2))
reverse(nil) → nil
reverse(add(z0, z1)) → app(reverse(z1), add(z0, nil))
shuffle(nil) → nil
shuffle(add(z0, z1)) → add(z0, shuffle(reverse(z1)))
Tuples:
APP(add(z0, z1), z2) → c1(APP(z1, z2))
REVERSE(add(z0, z1)) → c3(APP(reverse(z1), add(z0, nil)), REVERSE(z1))
SHUFFLE(add(z0, z1)) → c5(SHUFFLE(reverse(z1)), REVERSE(z1))
S tuples:
APP(add(z0, z1), z2) → c1(APP(z1, z2))
REVERSE(add(z0, z1)) → c3(APP(reverse(z1), add(z0, nil)), REVERSE(z1))
SHUFFLE(add(z0, z1)) → c5(SHUFFLE(reverse(z1)), REVERSE(z1))
K tuples:none
Defined Rule Symbols:
app, reverse, shuffle
Defined Pair Symbols:
APP, REVERSE, SHUFFLE
Compound Symbols:
c1, c3, c5
(3) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
SHUFFLE(add(z0, z1)) → c5(SHUFFLE(reverse(z1)), REVERSE(z1))
We considered the (Usable) Rules:
reverse(nil) → nil
reverse(add(z0, z1)) → app(reverse(z1), add(z0, nil))
app(nil, z0) → z0
app(add(z0, z1), z2) → add(z0, app(z1, z2))
And the Tuples:
APP(add(z0, z1), z2) → c1(APP(z1, z2))
REVERSE(add(z0, z1)) → c3(APP(reverse(z1), add(z0, nil)), REVERSE(z1))
SHUFFLE(add(z0, z1)) → c5(SHUFFLE(reverse(z1)), REVERSE(z1))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(APP(x1, x2)) = 0
POL(REVERSE(x1)) = 0
POL(SHUFFLE(x1)) = [2]x1
POL(add(x1, x2)) = [1] + x2
POL(app(x1, x2)) = x1 + x2
POL(c1(x1)) = x1
POL(c3(x1, x2)) = x1 + x2
POL(c5(x1, x2)) = x1 + x2
POL(nil) = 0
POL(reverse(x1)) = x1
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
app(nil, z0) → z0
app(add(z0, z1), z2) → add(z0, app(z1, z2))
reverse(nil) → nil
reverse(add(z0, z1)) → app(reverse(z1), add(z0, nil))
shuffle(nil) → nil
shuffle(add(z0, z1)) → add(z0, shuffle(reverse(z1)))
Tuples:
APP(add(z0, z1), z2) → c1(APP(z1, z2))
REVERSE(add(z0, z1)) → c3(APP(reverse(z1), add(z0, nil)), REVERSE(z1))
SHUFFLE(add(z0, z1)) → c5(SHUFFLE(reverse(z1)), REVERSE(z1))
S tuples:
APP(add(z0, z1), z2) → c1(APP(z1, z2))
REVERSE(add(z0, z1)) → c3(APP(reverse(z1), add(z0, nil)), REVERSE(z1))
K tuples:
SHUFFLE(add(z0, z1)) → c5(SHUFFLE(reverse(z1)), REVERSE(z1))
Defined Rule Symbols:
app, reverse, shuffle
Defined Pair Symbols:
APP, REVERSE, SHUFFLE
Compound Symbols:
c1, c3, c5
(5) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^2))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
REVERSE(add(z0, z1)) → c3(APP(reverse(z1), add(z0, nil)), REVERSE(z1))
We considered the (Usable) Rules:
reverse(nil) → nil
reverse(add(z0, z1)) → app(reverse(z1), add(z0, nil))
app(nil, z0) → z0
app(add(z0, z1), z2) → add(z0, app(z1, z2))
And the Tuples:
APP(add(z0, z1), z2) → c1(APP(z1, z2))
REVERSE(add(z0, z1)) → c3(APP(reverse(z1), add(z0, nil)), REVERSE(z1))
SHUFFLE(add(z0, z1)) → c5(SHUFFLE(reverse(z1)), REVERSE(z1))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(APP(x1, x2)) = 0
POL(REVERSE(x1)) = [2] + x1
POL(SHUFFLE(x1)) = [2]x12
POL(add(x1, x2)) = [1] + x2
POL(app(x1, x2)) = x1 + x2
POL(c1(x1)) = x1
POL(c3(x1, x2)) = x1 + x2
POL(c5(x1, x2)) = x1 + x2
POL(nil) = 0
POL(reverse(x1)) = x1
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
app(nil, z0) → z0
app(add(z0, z1), z2) → add(z0, app(z1, z2))
reverse(nil) → nil
reverse(add(z0, z1)) → app(reverse(z1), add(z0, nil))
shuffle(nil) → nil
shuffle(add(z0, z1)) → add(z0, shuffle(reverse(z1)))
Tuples:
APP(add(z0, z1), z2) → c1(APP(z1, z2))
REVERSE(add(z0, z1)) → c3(APP(reverse(z1), add(z0, nil)), REVERSE(z1))
SHUFFLE(add(z0, z1)) → c5(SHUFFLE(reverse(z1)), REVERSE(z1))
S tuples:
APP(add(z0, z1), z2) → c1(APP(z1, z2))
K tuples:
SHUFFLE(add(z0, z1)) → c5(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(add(z0, z1)) → c3(APP(reverse(z1), add(z0, nil)), REVERSE(z1))
Defined Rule Symbols:
app, reverse, shuffle
Defined Pair Symbols:
APP, REVERSE, SHUFFLE
Compound Symbols:
c1, c3, c5
(7) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^3))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
APP(add(z0, z1), z2) → c1(APP(z1, z2))
We considered the (Usable) Rules:
reverse(nil) → nil
reverse(add(z0, z1)) → app(reverse(z1), add(z0, nil))
app(nil, z0) → z0
app(add(z0, z1), z2) → add(z0, app(z1, z2))
And the Tuples:
APP(add(z0, z1), z2) → c1(APP(z1, z2))
REVERSE(add(z0, z1)) → c3(APP(reverse(z1), add(z0, nil)), REVERSE(z1))
SHUFFLE(add(z0, z1)) → c5(SHUFFLE(reverse(z1)), REVERSE(z1))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(APP(x1, x2)) = x1
POL(REVERSE(x1)) = x12
POL(SHUFFLE(x1)) = x13
POL(add(x1, x2)) = [1] + x2
POL(app(x1, x2)) = x1 + x2
POL(c1(x1)) = x1
POL(c3(x1, x2)) = x1 + x2
POL(c5(x1, x2)) = x1 + x2
POL(nil) = 0
POL(reverse(x1)) = x1
(8) Obligation:
Complexity Dependency Tuples Problem
Rules:
app(nil, z0) → z0
app(add(z0, z1), z2) → add(z0, app(z1, z2))
reverse(nil) → nil
reverse(add(z0, z1)) → app(reverse(z1), add(z0, nil))
shuffle(nil) → nil
shuffle(add(z0, z1)) → add(z0, shuffle(reverse(z1)))
Tuples:
APP(add(z0, z1), z2) → c1(APP(z1, z2))
REVERSE(add(z0, z1)) → c3(APP(reverse(z1), add(z0, nil)), REVERSE(z1))
SHUFFLE(add(z0, z1)) → c5(SHUFFLE(reverse(z1)), REVERSE(z1))
S tuples:none
K tuples:
SHUFFLE(add(z0, z1)) → c5(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(add(z0, z1)) → c3(APP(reverse(z1), add(z0, nil)), REVERSE(z1))
APP(add(z0, z1), z2) → c1(APP(z1, z2))
Defined Rule Symbols:
app, reverse, shuffle
Defined Pair Symbols:
APP, REVERSE, SHUFFLE
Compound Symbols:
c1, c3, c5
(9) SIsEmptyProof (EQUIVALENT transformation)
The set S is empty
(10) BOUNDS(O(1), O(1))